﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using CompanyManageModel;
using CompanyManageRepository;
using CompanyManageRepository.sugar;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using SqlSugar;

namespace CompanyManageAPI
{
    public class Program
    {
        public static void Main(string[] args)
        {

            var connectionConfig = new ConnectionConfig();
            //connectionConfig.DbType = DbType.Sqlite;
            //connectionConfig.InitKeyType = InitKeyType.Attribute;
            //connectionConfig.ConnectionString = @"DataSource = E:\MyProjects\CompanyManageAPI\CompanyManageRepository\CompanyManage.db";
            //var db = DbContext.GetCustomDB(connectionConfig);

            //try
            //{
            //    db.CodeFirst.InitTables(typeof(Company), typeof(Employee));
            //}
            //catch (Exception e)
            //{
            //    var a = e;
            //}

            CreateWebHostBuilder(args).Build().Run();

        }

        public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
            WebHost.CreateDefaultBuilder(args)
                .UseStartup<Startup>();
    }

    class TEST
    {
        public string ID { get; set; }
        public string NAME { get; set; }
    }
}
